home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swags_z.zip / STRINGS.SWG / 0041_Convert INTEGER to string.pas < prev    next >
Pascal/Delphi Source File  |  1993-09-26  |  827b  |  27 lines

  1. {*****************************************************************************
  2.  * Function ...... ITOS()
  3.  * Purpose ....... Convert an integer to a string <nSpaces> in length
  4.  * Parameters .... nNum       Integer to convert
  5.  *                 nSpaces    Length of resultant string
  6.  * Returns ....... nNum as a string, <nSpaces> in length
  7.  * Notes ......... None
  8.  * Author ........ Martin Richardson
  9.  * Date .......... May 13, 1992
  10.  *****************************************************************************}
  11. FUNCTION ITOS( nNum: LONGINT; nSpaces: INTEGER ): STRING;
  12. VAR
  13.    s: ^STRING;
  14. BEGIN
  15.      ASM  
  16.           mov     sp, bp 
  17.           push    ss
  18.           push    WORD PTR @RESULT
  19.      END;
  20.  
  21.      IF nSpaces > 0 THEN
  22.          STR( nNum:nSpaces, s^ )
  23.      ELSE
  24.          STR( nNum:0, s^ );
  25. END;
  26.  
  27.